package com.woniu.cq.medical.config;

import org.springframework.context.annotation.Configuration;

import java.io.FileWriter;
import java.io.IOException;
@Configuration
public class AlipayConfig {
    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000116681500";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCwlZveXAAzn6sWdcpnzhWrfl5dzZuUq/lFsrxyHUrnjYvBVPvbQsPVl1XFDXeCsQBkTnsa7oGSsjmt5lAvaQlvU93jEiTJvnosw3zc/P/fibstx/KcYqvvYc8ZSX/76VPbKe2cnbvHlGkhtF079FcIQxqsS305fxX7YBNFOqRcxSyRv6yia0eRPoszQjyoiMyKPqJWQ0kLsXcPpJW2MenWfFp8l1VU1oT3LD6FjcEjBvnQrPla5meWIB3tG7+v5FqofjWuMtM3kgndZwGI/uCCABh4IOi+PZ82X7nwl+elMBSOk+GF1+mHheBxlc5UEq80yt12wtbvpGSpx38rTNuBAgMBAAECggEAbhYHIzvl4EklZw4uDkL7XXudpwsceDYyZBJGyzmZzft/ahrqHMplvk3nab64h+CDJwWKV8LjQqobrV9NFBF+kUoOpZZVGvTFxAxnVnnfpuN9rs/dX0Ngfw9SBii9QjY3UgW0nZP0Ujsiw6FnEo6Eh6EWCt3RBrxE3v8JZHpnp3E38uPfVMg6qcLSb0YXyPuzgfEE7j7JQNNm2588HSyluU6nAouQRx6pCI5Xay/RX70oOFHfrri+Q8gygKGFHQA7ZBCq2BH8daP1yRv4XlUOJm0o1/WhOc5cZmznJWXv4Qlr24iQwaYje71fcMiipofDTl/pxG/MPWjA0FUo51erpQKBgQDX5zwpdJ2O6rlWmY5+QDBvyKWU59Uzm29z2MQsxd+uJXmcTHGiqmwJHNFNrezAt5Z8RIlPNhs3NH+S5zvKqcHEpMOzORh6GXqpvZ4Lfh6NGf3KG9J/eS1IhmXp9fxzdl2sfur925LmFNGuqXNgPqGnl0LaaU4L4wKwHS10LHb35wKBgQDRYQYW4j3IE6qxOCwdZvnnKas0hZI76aWCK8RPRYsTpbR2fN/F71O+kcIBoZdvw9O9gVleT9MCPK5rgEHnr+qHs6OosVYx/xrBnm+vAXZjPKEVvhFjSh3aQdDP3tsOSHc78CC2vQE+AjJl79vhkrkEnpUjRnCScxB1Fs/bqSkEVwKBgQCaNn1fcv9TZM8rTxVbkkfGoH+9A3binMSX7534CQJDJltdy7BjKu1t+Np7bJ6t7LQdYOre3FvGK8ZvzKCFmolgBvwN2Ntl4ysdcOYheV0jFgyTvxm0mX5BzlWfLme6pTI1kpYQ6zRbCUXYRwq1FSdsSHuk/BCWJvj1iHG+CECVwwKBgQCMYweYNF3EVxtt9AHwPOl2i0PV1XF1ZnWoz/uyQyi7JbHYeGX56zw1XLm+KkDFmYHRYHcxe0g6CcHRJpAJ7rPMBTDInQ70Ot4P0FGF/+8HHtHLKEO0VS+q9dIybnRmIUSBFcJ5hETe9M4h9y9xEdWoOUQ6ALLeHvR77a201LlBxQKBgDNbVK6sKIzERLjCnMBirten16TLUfmYXMNukHNnu2eIAtYUs/fOwzpY17m+zd/60xpTVY0+uUF2glW/QMh2lphDzV5r7gGvBf1txR+vw3pW7xCdBt1Ikdpfg6M0OSHW3dlMahhCKupwcJ0fCdDK4Pjxwl5IaUxDTWqei70XBkZP";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmLaDiU4QQ0YVHVe/EI5Gi47DIGGfwLZ9CpJOOGkUW7i75yEa2bTnSxUbaeN3l68j1nuG76nR8FJAw23B+dZVcOskAsWQksWqsNIUFXmHseI2XNaXsl7Sd4dP0VRemMVhw/puJNBefopyLrvZi4bTfLnSd3IxoMYvo/cPpPlBjg6PqcILC1g03X98T9oA36/MEFDIH1uiC8jDl8w9K2cbrMO2AL/08HKVTLrmHN4K8+SKsNWzM1yUdzgx2YXHHwnXvQKzQe8Hfg4IL0dn9vbt8aLvzt5fF2YuPlgKhJa4mfsU0ycQmVM+9KLEq70dh2bJwM+vMOhZ01F7560rSCSebQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://hh33082533.zicp.vip/medical/check-apply/payAll";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://hh33082533.zicp.vip/charge.html";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
